//
//  AppConfig.h
//  CsdnPlus
//
//  Created by 孟瑞瑞 on 2018/5/17.
//  Copyright © 2018年 CSDN. All rights reserved.
//

#ifndef AppConfig_h
#define AppConfig_h


#define MenuItemsDic [NSString pathWithComponents:@[NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES).firstObject, @"/MenuItems"]]
#define InUseItemsPath [NSString pathWithComponents:@[NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES).firstObject, @"/MenuItems/newNineInUsesItems.plist"]]
#define UnUseItemsPath [NSString pathWithComponents:@[NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES).firstObject, @"/MenuItems/newNineUnUsesItems.plist"]]

#pragma mark - 苹果 id

#define AppleAppID  @"1437086352"

#pragma mark - 数美上报

#define kSMorganization @"E2fSjOLnvVdMRc4jLSih"

#pragma mark - 微博
#define kSinaKey @"1403707668"
#define kSinaAppSecret @"d46e7112516d4fa1ae504abaf7b24868"
#define kREDIRECT_URL @"https://www.csdn.net"

#pragma mark - 微信
#define kWeixinAppKey @"wxbe200eb33fcdf285"
#define kWeixinAppSecret @"a463052105bf48f72ec678bfd36596b8"
#define kWeixinCode @"weixinCode"
#define kWeixinTypeLogin @"CSDNInteractionWeixinLoginType"

#pragma mark - QQ
#define kQQTypeLogin @"CSDNInteractionQQLoginType"
#define kQQAppKey @"100270989"

#pragma mark - 钉钉
#define kDingDingAppKey @"dingoad2d40f5jhh8klmno"
#define kDingDingAppSecret @"-gyeZXUTn4hxtjVP4NwpinsysswvLTLGPHkamiYLpTGd7AyaBbOV8WQaHnAYaWmH"

#pragma mark -网易云信
#define kIMAppKey @"01135005fe41192be3f31c6ffbeab506"
#define kCSDNLogin     @"csdnLogin"
#define kQQLogin    @"qq"
#define kSinatLogin @"sinat"
#define kWeixin     @"weixin"


#define kLoginType @"loginType"
#define kIntercactionUserName @"intercactionUserName"
#define kIntercactionPassword @"intercactionPassword"
#define kUserNameAgreement @"userNameAgreement"

#define kOtherLoginOpenId @"otherLoginOpenId"
#define kOtherLoginUserName @"otherLoginUserName"

//登录标识
#define KLoginStatus @"login_status"

//登录类型
#define KLoginModel @"login_model"

//推送标识
#define KPushStatus @"push_status"

//用户设备号是否上传成功
#define kPushDeviceStatus @"push_device_status"

#define kSessionId @"SessionId"

#define kCSDNToken @"csdn_token"

#define kUserToken @"userToken"

#define kUserStatus @"userStatus"

#define kUserMobile @"userMobile"

#define kUserAreaCode @"userAreaCode"

#define kUserTailNumber @"userTailNumber"

//获取 SessionId
#define CN_SessionId [[NSUserDefaults standardUserDefaults]objectForKey:kSessionId]!= nil ? [[NSUserDefaults standardUserDefaults]objectForKey:kSessionId] : @""

#define CN_GWTToken [[NSUserDefaults standardUserDefaults]objectForKey:kCSDNToken]!= nil ? [[NSUserDefaults standardUserDefaults]objectForKey:kCSDNToken] : @""

#define CN_Cookieid [UUIDTool getUUID]!= nil ? [UUIDTool getUUID] : @""

#define CN_UUID [UUIDTool getUUID]!= nil ? [UUIDTool getUUID] : @""

// KeyChain 相关设置
#define  KEY_USERNAME_PASSWORD @"com.company.app.usernamepassword"
#define  KEY_USERNAME @"com.company.app.username"
#define  KEY_PASSWORD @"com.company.app.password"

//SSKeychain 相关设置
#define  KEY_ServiceName @"com.csdn.codePlus"


#define kBlogUserName @"blogUserName"

#define kUserMobile @"userMobile"

#define kJPushRegistrationID @"JPushRegistrationID"

#define kJPushReportStatus @"reportJPushStatus"

#define kPushUserName @"newPushUserName"

#define kHpCellContenHighest 40.f
#define kMaxUpdateImageWidthAndHeight 2048.f

#define kAESKey @"1db202f9149e061d"

#define kAESIv @"6hd2g3f9m41e0v1d"

//沙盒document路径
#define kCNDocumentPath NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject
#define kCNApplicationSupportPath [NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory,NSUserDomainMask,YES) objectAtIndex:0]

#define kEBookFolder @"ebooks"

#define kBlogCssFolder @"blogCss"

#define kDownloadFolder @"download"

#ifndef CNSnapshotBlockCallback
#define CNSnapshotBlockCallback(__BLOCK_NAME__, ...)   \
if (__BLOCK_NAME__) {\
__BLOCK_NAME__(__VA_ARGS__);\
}
#endif

#define kSingleImageHWRatioMax                  2.0  // 单张图片的最大高宽比

#define ImageViewHeightFor(__IMGAE__)  (kContentWidth * __IMGAE__.size.height / (__IMGAE__.size.width > 0 ? __IMGAE__.size.width : 1)) // 防止出现除以 0 的情况

#define kContentWidth  (isPad ? (414-32) : (kWindowW - 32))

#define ImageViewLimitedHeightFor(__IMGAE__)    (ImageViewHeightFor(__IMGAE__) > kContentWidth * kSingleImageHWRatioMax ?\
kContentWidth * kSingleImageHWRatioMax :\
ImageViewHeightFor(__IMGAE__))  //  限制图片高宽比
static NSString *const CNLoginSuccessGuidePostDynamicNotification = @"CNLoginSuccessGuidePostDynamicNotification";

static NSString *const CNLoginSuccessNotification = @"CNLoginSuccessNotification";

static NSString *const CNThemeUpdateNotification = @"CNThemeUpdateNotification";

static NSString * const kSnapshotShareDescDefault = @"长按识别二维码，查看详情";

static NSString * const kSnapshotShareSourceDefault = @"由 CSDN APP 分享";

static NSString * const kSnapshotShareUrlDefault = @"https://csdn.net";

static NSString * const kSnapshotShareUrlPre = @"https://www.csdn.net/apps/download?code=blink_1554686969";

static NSString * const kSnapshotMyCardShareUrlPre = @"https://www.csdn.net/apps/download?code=app_1561708395";

static NSString * const kSnapshotMyRankinglListShareUrlPre = @"https://www.csdn.net/apps/download?code=blink_1561974617";

static NSString * const kSnapshotMyFansTrendShareUrlPre = @"https://www.csdn.net/apps/download?code=blink_1556418341";

static NSString * const kSnapshotMyMedalShareUrlPre = @"https://www.csdn.net/apps/download?code=app_1562551557";

//static NSString * const kSnapshotShareUrlPre = @"http://192.168.81.3:8080/app/app.html?code=blink_1554686969";

static NSString * const CNSnapshotErrorDomain = @"com.csdn.snapshot.ErrorDomain";

static NSString * const CNAPPSecret = @"705A013EB5F2F574CF61A52C1C08973C";

static NSString * const CNAPPOrderSecret = @"zU3eG1uvNh9Vv9Oj5evNPiuSufTe6HJa";

static  NSString * aliyunLogEndpoint = @"cn-beijing.log.aliyuncs.com";
static  NSString * aliyunLogProject = @"csdn-app";
//阅读时长搜索词
static  NSString * aliyunLogLogStorePageView = @"csdn-app-tracking-pageview";
// 列表曝光
static  NSString * aliyunLogLogStorePageExposure = @"csdn-app-tracking-page-exposure";
// 列表点击
static  NSString * aliyunLogLogStorePageClick = @"csdn-app-tracking-page-click";

//用户行为
static  NSString * aliyunLogLogStoreUserAction = @"csdn-app-client-user-action";

//crash上报的路径
static  NSString * aliyunCrashLogStore = @"csdn-app-dev-log-exception";
#pragma mark ------ newLogStore

static  NSString * newAliyunPVEventLogStore = @"csdn-app-client-track-view";
// 列表曝光
static  NSString * newAliyunExposureEventLogStore = @"csdn-app-client-track-exposure";
// 列表点击
static  NSString * newAliyunPageClickEventLogStore = @"csdn-app-client-track-all";
//用户行为
static  NSString * newAliyunUserActionEventLogStore = @"csdn-app-client-track-event";

//---------------------------------------------------------------------------
static  NSString * aliyunLogAccessKeyID = @"LTAITdykU9F1N9vm";
static  NSString * aliyunLogAccessKeySecret = @"tscUqpbsxIcYUbH0cVF7WrWvVActJf";

static  NSString * kEbookEncryptKey = @"5ur1lidkjmsprfrt";
static  NSString * kEbookEncryptIv = @"araifkesh6j5oodz";


#ifdef DEBUG
static  NSString * aliyunLogJson = @"json";
#else
static  NSString * aliyunLogJson = @"json";
#endif

#ifdef DEBUG
static  NSString * aliyunLogIsTest = @"true";
#else
static  NSString * aliyunLogIsTest = @"false";
#endif



typedef NS_ENUM(NSInteger, CNSnapshotErrorCode) {
    CNSnapshotContentEmptyError           = 100,
    CNSnapshotQRCodeGeneratingFailedError = 101,
    CNSnapshotImageDownloadingFailedError = 102,
    CNSnapshotViewGeneratingFailedError   = 103,
    CNSnapshotSharingFailedError          = 104,
};

static NSUInteger const kSnapshotImageDataLengthMax = 4 * 1024 * 1024; // 最大 4 M

#endif /* AppConfig_h */
